<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title>External Practitioner Summary</title>
		<link href="./css/default.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript" src="./js/jsx.js"></script>
		<script type="text/javascript" src="./js/jsml.js"></script>
		<script type="text/javascript" src="./js/ui.js"></script>
		<script type="text/javascript" src="./js/ris.js"></script>
		<script type="text/javascript" src="./js/SR.js"></script>
		<script type="text/javascript" src="./js/preview.js"></script>
		<script type="text/javascript" >
		var imagePath = "./images";

		function onBodyLoad()
		{
			if(!Ris)
				return;

			var context = Ris.getHealthcareContext();
			if (!context)
				return;

			if (context.PractitionerDetail)
			{
				Preview.ExternalPractitionerSummary.create($("externalPractitionerSummary"), context.PractitionerDetail);
			}
			else if (context.PractitionerSummary)
			{
				var service = Ris.getService("ClearCanvas.Ris.Application.Common.Admin.ExternalPractitionerAdmin.IExternalPractitionerAdminService, ClearCanvas.Ris.Application.Common");
				var request = 
				{
					PractitionerRef: context.PractitionerSummary.PractitionerRef
				};

				service.loadExternalPractitionerForEditAsync(
					request,
					function(response) {
						// populate the preview
						Preview.ExternalPractitionerSummary.create($("externalPractitionerSummary"), response.PractitionerDetail);
					});
			}
		}
		</script>
		<style>
		</style>
	</head>
	<body onload="onBodyLoad()">
		<form id="myForm">
			<div id="externalPractitionerSummary"></div>
			<div id="errorMsg"></div>
		</form>
	</body>
</html>
